package chances.epg.data.taglib;

import javax.servlet.jsp.JspException;

import org.slf4j.Logger;

import chances.epg.commons.log.EpgLogFactory;
import chances.epg.data.service.BaseDataRepertory;
import chances.epg.entity.biz.CornerMark;

public class CornerMarkTag extends QueryTag {
	private static final Logger logger = EpgLogFactory.getSystemLogger();

	/**
	 * serialVersionUID.
	 */
	private static final long serialVersionUID = 3399601666905725793L;
	private String code;

	@Override
	public int doEndTag() throws JspException {
		String code = this.getCode();

		try {
			CornerMark mark = BaseDataRepertory.getInstance().getCornerMark(code);
			this.setResult(mark);
		} catch (Throwable ex) {
			logger.error("BizTag error", ex);
		}

		return super.doEndTag();
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
}
